﻿using Modules.Project;
using PetaPoco;
using PmSoft;
using PmSoft.Caching;

namespace Modules
{
    /// <summary>
    /// 保证金收支信息
    ///</summary>
    [TableName("project_security_deposit_records")]
    [PrimaryKey("Id", AutoIncrement = true)]
    [CacheSetting(true)]
    [Serializable]
    public class ProjectSecurityDepositRecords : IEntity
    {
        /// <summary>
        /// 主键
        ///</summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 保证金账户id
        ///</summary>
        [Column("security_deposit_id")]
        public int SecurityDepositId { get; set; }

        /// <summary>
        /// 收支编号
        ///</summary>
        [Column("code")]
        public string Code { get; set; }

        /// <summary>
        /// 项目id
        ///</summary>
        [Column("project_id")]
        public int ProjectId { get; set; }

        /// <summary>
        /// 收支类型(进账,出账)
        ///</summary>
        [Column("income_type")]
        public 收支类型 IncomeType { get; set; }

        /// <summary>
        /// 交易类型(资金入账,代发工资,计息,手续费,其他)
        ///</summary>
        [Column("trading_type")]
        public 交易类型 TradingType { get; set; }

        /// <summary>
        /// 缴存类型(按预设比例缴存,免除保证金,减少保证金应交金额,缓缴保证金,增加保证金应缴金额)
        ///</summary>
        [Column("deposite_type")]
        public 缴存类型 DepositeType { get; set; }

        /// <summary>
        /// 缓存起始日期
        ///</summary>
        [Column("deposite_start_date")]
        public DateTime DepositeStartDate { get; set; }

        /// <summary>
        /// 差异化缓存金额
        ///</summary>
        [Column("differentiated_cache_amount")]
        public decimal DifferentiatedCacheAmount { get; set; }

        /// <summary>
        /// 收支方式(现金,银行保函,工程担保公司保函,工程保证保险,其它)
        ///</summary>
        [Column("income_way")]
        public 收支方式 IncomeWay { get; set; }

        /// <summary>
        /// 应缴金额
        ///</summary>
        [Column("amount_payable")]
        public decimal? AmountPayable { get; set; }

        /// <summary>
        /// 已缴纳金额
        ///</summary>
        [Column("paid_amount")]
        public decimal PaidAmount { get; set; }

        /// <summary>
        /// 工资保证金开户银行
        ///</summary>
        [Column("bank_name")]
        public string? BankName { get; set; }

        /// <summary>
        /// 工资保证金银行账号
        ///</summary>
        [Column("bank_number")]
        public string? BankNumber { get; set; }

        /// <summary>
        /// 现金金额
        ///</summary>
        [Column("cash_amount")]
        public decimal? CashAmount { get; set; }

        /// <summary>
        /// 担保银行名称
        ///</summary>
        [Column("guarantee_bank_name")]
        public string? GuaranteeBankName { get; set; }

        /// <summary>
        /// 银行保函涵号
        ///</summary>
        [Column("bank_guarantee_number")]
        public string? BankGuaranteeNumber { get; set; }

        /// <summary>
        /// 银行保函担保金额
        ///</summary>
        [Column("bank_guarantee_amount")]
        public string? BankGuaranteeAmount { get; set; }

        /// <summary>
        /// 银行保函有效期起始日期
        ///</summary>
        [Column("bank_guarantee_start_date")]
        public DateTime? BankGuaranteeStartDate { get; set; }

        /// <summary>
        /// 银行保函有效期终止日期
        ///</summary>
        [Column("bank_guarantee_end_date")]
        public DateTime? BankGuaranteeEndDate { get; set; }

        /// <summary>
        /// 工程担保公司名称
        ///</summary>
        [Column("guarantee_company_name")]
        public string GuaranteeCompanyName { get; set; }

        /// <summary>
        /// 工程担保公司保函涵号
        ///</summary>
        [Column("guarantee_company_number")]
        public string? GuaranteeCompanyNumber { get; set; }

        /// <summary>
        /// 工程担保公司担保金额
        ///</summary>
        [Column("guarantee_company_amount")]
        public DateTime? GuaranteeCompanyAmount { get; set; }

        /// <summary>
        /// 工程担保公司保函有效起始日期
        ///</summary>
        [Column("guarantee_company_start_date")]
        public DateTime? GuaranteeCompanyStartDate { get; set; }

        /// <summary>
        /// 工程担保公司保函有效终止日期
        ///</summary>
        [Column("guarantee_company_end_date")]
        public DateTime? GuaranteeCompanyEndDate { get; set; }

        /// <summary>
        /// 保险公司名称
        ///</summary>
        [Column("insurance_company_name")]
        public string? InsuranceCompanyName { get; set; }

        /// <summary>
        /// 保险单号
        ///</summary>
        [Column("insurance_number")]
        public string? InsuranceNumber { get; set; }

        /// <summary>
        /// 保单金额
        ///</summary>
        [Column("insurance_amount")]
        public decimal? InsuranceAmount { get; set; }

        /// <summary>
        /// 保险有效期起始日期
        ///</summary>
        [Column("insurance_start_date")]
        public DateTime? InsuranceStartDate { get; set; }

        /// <summary>
        /// 保险有效期终止日期
        ///</summary>
        [Column("insurance_end_date")]
        public DateTime? InsuranceEndDate { get; set; }

        /// <summary>
        /// 其他金额
        ///</summary>
        [Column("other_amount")]
        public string? OtherAmount { get; set; }

        /// <summary>
        /// 收支日期
        ///</summary>
        [Column("records_date")]
        public DateTime? RecordsDate { get; set; }

        /// <summary>
        /// 创建时间
        ///</summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; }

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        #endregion IEntity 成员
    }
}